<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <script>
      var a = new Date(); //获取系统当前时间 new Date()
      var day = a.getDay(); //js面向对象的用法 getDay()得到的值为0-6
      switch(day){
          case 1:
              alert("星期一");
              break;
          case 2:
              alert("星期二");
              break;
          case 3:
              alert("星期三");
              break;
          case 4:
              alert("星期四");
              break;
          case 5:
              alert("星期五");
              break;
          case 6:
              alert("星期六");
              break;
          default:
              alert("星期日");
      }
  </script>
</body>
</html>